package com.pandora.credit.mongo.service.impl;

import com.pandora.credit.mongo.dao.MongoMessageDao;
import com.pandora.credit.mongo.entity.MongoMessage;
import com.pandora.credit.mongo.service.MongoMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author developer
 */
@Service
public class MongoMessageServiceImpl implements MongoMessageService {

    @Autowired
    private MongoMessageDao messageDao;

    @Override
    public List<MongoMessage> queryByIsSent(int isSent) {
        return messageDao.selectByIsSent(isSent);
    }

    @Override
    public void save(MongoMessage message){
        messageDao.insert(message);
    }

    @Override
    public MongoMessage getFromId(long id) {
        return messageDao.getFromId(id);
    }
}
